<div class="col-lg-12">
    @include('admin.contents.bar')
    <section class="panel">
        {{ Form::open(array('route' => 'admin.contents.store','class'=>'form-horizontal', 'data-validate'=>"parsley")) }}
        <header class="panel-heading">
            <div class="pull-left"><i class="fa fa-edit fa-lg"></i> Add Content</div>
        </header>
        <div class="panel-body">
            @if ($errors->any())
                <ul class="alert alert-danger">
                    {{ implode('', $errors->all('<p>:message</p>')) }}
                </ul>
            @endif
            <div class="form-group">
                <label class="col-lg-3 control-label">Title</label>
                <div class="col-lg-8">
                    <input type="text" class="bg-focus form-control parsley-validated" data-required="true" placeholder="Title" name="title" value="{{ Input::old('title') }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Category</label>
                <div class="col-lg-8">
                    <select name="categoryID" class="form-control">
                        <option value="">Select Category</option>
                        @foreach($categories as $key => $value)
                            <option value="{{$value->id}}" @if(Input::old('categoryID')==$value->id) selected="selected" @endif >{{$value->name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>                
            <div class="form-group">
                <label class="col-lg-3 control-label">Description</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control parsley-validated" data-required="true" placeholder="Description" name="description" value="{{ Input::old('description') }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Content</label>
                <div class="col-lg-8">
                    <textarea data-rangelength="[20,200]" data-trigger="keyup" class="form-control parsley-validated" rows="5" placeholder="Content" value="content">{{ Input::old('content') }}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Author</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control" placeholder="Author" name="author" value="{{ Input::old('author') }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Active</label>
                <div class="col-lg-8">
                    <div class="checkbox">
                        <input type="checkbox" name="active" value="Y" @if(Input::old('active')=='Y') checked="checked" @endif>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <h5 class="col-lg-3 control-label">SEO</h5>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Meta title</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control parsley-validated" data-required="true" placeholder="Meta Title" name="html_meta_title" value="{{ Input::old('html_meta_title') }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Meta Description</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control parsley-validated" data-required="true" placeholder="Meta Description" name="html_meta_description" value="{{ Input::old('html_meta_description') }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Meta Keywords <small>(keyword,keyword2,keyword3)</small></label>
                <div class="col-lg-8">
                    <input type="text" class="form-control parsley-validated" data-required="true" placeholder="Meta Keyword" name="html_meta_keywords" value="{{ Input::old('html_meta_keyword') }}">
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-9 col-lg-offset-3">
                    <button class="btn btn-white btn-primary" type="submit">Save Content</button>
                    <a class="btn" href="{{ URL::to('admin/contents') }}">Cancel</a>
                </div>
            </div>
        </div>
        {{ Form::close() }}
    </section>
</div>
